package com.raising.modules.sys.service;

import com.raising.framework.service.CrudService;
import com.raising.modules.sys.dao.OrganizationDao;
import com.raising.modules.sys.entity.Organization;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * 组织机构服务
 * 
 * @author gaoy
 */
@Service
@Transactional(rollbackFor = Exception.class)
public class OrganizationService extends CrudService<OrganizationDao, Organization> {

    /**
     * 查询是否存在下级节点
     * @param organization
     * @return
     */
    public int findNext(Organization organization){
        return dao.findNext(organization);
    }
    
    /**
     * 根据父机构id查询子组织机构列表
     * @author peijs
     * @param org
     * @return
     * @throws Exception
     */
    public List<Organization> findOrganizationList(Organization org) throws Exception{
		return dao.findOrganizationList(org);
	}
    
    /**
     * 查找所有的组织机构
     * @author fangl
     * 2017-6-1 下午5:12:31 
     * @return
     */
    public List<Organization> findOrganizationListW(){
    	return dao.findOrganizationListW();
    }
}
